/*
 * create:2016年4月8日 上午9:41:49
 * author:wangds  
 */
package com.cxkj.shop.proc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import net.wangds.common.processor.AbstractProcessorWithResult;
import net.wangds.comp.business.http.HttpBusiness;

/**
 * .
 * @author wangds
 *
 */
public class GetHttpSessionProc extends AbstractProcessorWithResult<HttpSession>{

  private HttpBusiness businessObject;
  private boolean forceCreate = false;
  /**
   * The getter method of the property businessObject.
   * @author wangds 2016年4月8日 上午9:49:34.
   * @return the businessObject.
   */
  public HttpBusiness getBusinessObject() {
    return businessObject;
  }

  /**
   * The setter method of the property businessObject.
   * @param thebusinessObject the businessObject to set
   * @author wangds 2016年4月8日 上午9:49:34.
   */
  public void setBusinessObject(HttpBusiness businessObject) {
    this.businessObject = businessObject;
  }
  
  
  /**
   * The getter method of the property forceCreate.
   * @author wangds 2016年4月8日 上午9:51:49.
   * @return the forceCreate.
   */
  public boolean isForceCreate() {
    return forceCreate;
  }

  /**
   * The setter method of the property forceCreate.
   * @param theforceCreate the forceCreate to set
   * @author wangds 2016年4月8日 上午9:51:49.
   */
  public void setForceCreate(boolean forceCreate) {
    this.forceCreate = forceCreate;
  }

  /*
   * @see net.wangds.common.processor.AbstractProcessorWithResult#execute()
   * @author wangds 2016年4月8日 上午9:44:27.
   */
  @Override
  protected HttpSession execute() {
    HttpSession res = null;
    HttpBusiness biz = this.getBusinessObject();
    if(biz==null){
      return res;
    }
    HttpServletRequest req = biz.getHttpRequest();
    if(req==null){
      return res;
    }
    res = req.getSession(isForceCreate());
    return res;
  }



}
